package com.bilibili.juc.locks_2.demo_eight;

import java.util.concurrent.TimeUnit;

/**
 * TODO
 *
 * @author 陈賝
 * @since 2024/5/28 16:42
 */
public class PhoneStatisticCommon //资源类
{
    /**
     * 类锁
     */
    public static synchronized void sendEmail()  {
        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("-----sendEmail");
    }

    /**
     * 对象锁
     */
    public synchronized void sendSMS() {
        System.out.println("-----sendSMS");
    }

    public void hello() {
        System.out.println("-------hello");
    }
}
